﻿<me:PDCBase x:Class="WPFExcelReport.XSGB02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                   Background="White"  
                    Loaded="Window_Loaded"
     >
    <me:PDCBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <CollectionViewSource   x:Key="vwGLLG" Source="{Binding Path=SetEnv.GLLG}" />
        <CollectionViewSource   x:Key="vwTGLLG" Source="{Binding Path=SetData.GLLG}" />
    </me:PDCBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*">
                    
                </ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" MaxWidth="250"  MaxHeight="100">
                <TextBlock  Text="{Binding Pattern}" TextWrapping="Wrap"></TextBlock>
            </ScrollViewer>
            <StackPanel Grid.Column="0" >
                <WrapPanel  Margin="10,0,0,10">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock FontSize="18" Grid.Column="0" Text="生产仓库:"></TextBlock>
                        <TextBox Grid.Column="1" Foreground="Red" MaxLength="2" CharacterCasing="Upper"  FontSize="18" Text="{Binding GLLO}" Width="40" />
                        <TextBox Grid.Column="2" Foreground="Red"  MaxLength="2"  CharacterCasing="Upper"  FontSize="18" Text="{Binding GLLB}" Width="40" />
                        <TextBox Grid.Column="3" Foreground="Red"  MaxLength="8"  CharacterCasing="Upper"  FontSize="18" Text="{Binding GLLP}" Width="60" />
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" FontSize="18"  Content="查询" Click="btnQuery_Click" />
                        <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0"  Click="btnQuery_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Search.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                </WrapPanel>
                <WrapPanel>
                    <Grid  >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="18" Text="入库日期:" ></TextBlock>
                        <DatePicker Grid.Column="1" Height="30" HorizontalAlignment="Left" Name="FROM_DATE" VerticalAlignment="Center" 
                                    FontSize="16" SelectedDateChanged ="FROM_DATE_SelectedDateChanged" Width="125" />
                        <!--TextBox Grid.Column="1" Background="LightBlue"  FontSize="18"  Text="{Binding DATES}" Width="100" /-->
                        <TextBlock Grid.Column="2" FontSize="18" Text="-" ></TextBlock>
                        <!--TextBox Grid.Column="3"  Background="LightYellow" FontSize="18"  Text="{Binding DATET}" Width="100" /-->
                        <DatePicker Grid.Column="3" Height="30" HorizontalAlignment="Left" Name="END_DATE" VerticalAlignment="Center" Panel.ZIndex="2"
                                    FontSize="16" SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="122" />

                    </Grid>  
                </WrapPanel>
                <WrapPanel>
                    <Grid   Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="18" Text="纱批:" ></TextBlock>
                        <TextBox Grid.Column="1" Background="Yellow" FontSize="18" CharacterCasing="Upper" Text="{Binding SPINLOT}" Width="200" />
                    </Grid>

                </WrapPanel>
                <WrapPanel>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="18" Text="生产单:" ></TextBlock>
                        <TextBox Grid.Column="1" Margin="10,0,0,0"  CharacterCasing="Upper"  Background="LightPink" FontSize="18"  Text="{Binding KRS}" Width="30" />
                        <TextBox Grid.Column="2" Margin="10,0,0,0"  CharacterCasing="Upper"  Background="LightYellow"   FontSize="18"  Text="{Binding LFD}" Width="100" />
                        <TextBox Grid.Column="3" Margin="10,0,0,0"  CharacterCasing="Upper"  Background="LightBlue"  FontSize="18"  Text="{Binding POS}" Width="30" />
                    </Grid>
                    <Grid Margin="30,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" FontSize="18"  Content="重置" Click="btnReset_Click"/>
                        <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0"     Click="btnReset_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Reload.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                </WrapPanel>
            </StackPanel>
        </Grid>
       
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions> 
             
                <DataGrid  Grid.Row="1"  Grid.Column="0"
                            VerticalAlignment="Top"  
                           AutoGenerateColumns="False"
                           EnableRowVirtualization="False"
                           VerticalScrollBarVisibility="Auto"
                           HorizontalScrollBarVisibility="Auto"
                           HeadersVisibility="Column"     
                           FontSize="14"                           
                           RowDetailsVisibilityMode="Visible" 
                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwGLLG}}"  
                           x:Name="dlgGLLG"   
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=GLLBEHI, Converter={StaticResource ResourceKey=pnum}}" Header="ID"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=GPSPPART}" Header="纺批"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GLBSTKG, Converter={StaticResource ResourceKey=d1000}}" Header="KG"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=GLBEM, Converter={StaticResource ResourceKey=Trim}}" Header="包装"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GLPRODDAT}" Header="入库日期"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP04}" Header="销售单"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP05,Converter={StaticResource ResourceKey=gb2312}}" Header="留位"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPGART}" Header="纱线"  Width="Auto" />
                        
                        <DataGridTextColumn Binding="{Binding Path=GPGFARBE}" Header="色号"  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  >  
        </Grid>
        <WrapPanel Grid.Row="2" HorizontalAlignment="Center">

            <Grid Margin="40,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" FontSize="18"  Content="确认" Click="btnToConvert_Click"/>
                <Button Grid.Column="1" Height="30" Width="30" Margin="0,0,0,0"     Click="btnToConvert_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="/YGRCPGB04;component/Image/Forward.png" >
                            <ImageBrush.RelativeTransform>
                                <TransformGroup>
                                    <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                                    <SkewTransform CenterY="0.5" CenterX="0.5"/>
                                    <RotateTransform Angle="90" CenterY="0.5" CenterX="0.5"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </ImageBrush.RelativeTransform>
                        </ImageBrush>
                    </Button.Background>
                </Button>
            </Grid>

        </WrapPanel>
        <Grid Grid.Row="3"   Grid.Column="0"  >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <DataGrid  Grid.Row="1"   
                           VerticalAlignment="Top"  
                           AutoGenerateColumns="False"
                           EnableRowVirtualization="False"
                           VerticalScrollBarVisibility="Auto"
                           HorizontalScrollBarVisibility="Auto"
                           HeadersVisibility="Column"     
                           FontSize="14"                           
                           RowDetailsVisibilityMode="Visible" 
                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwTGLLG}}"                    >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=GLLBEHI, Converter={StaticResource ResourceKey=pnum}}" Header="ID"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPSPPART}" Header="纺批"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GLBSTKG, Converter={StaticResource ResourceKey=d1000}}" Header="KG"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GLBEM, Converter={StaticResource ResourceKey=Trim}}" Header="包装"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GLPRODDAT}" Header="入库日期"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP04}" Header="销售单"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=JP05,Converter={StaticResource ResourceKey=gb2312} }" Header="留位"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=GPGART}" Header="纱线"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=GPGFARBE}" Header="色号"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </Grid>
    </Grid>
</me:PDCBase>